/*
 * Copyright (c) 2007-2020 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.edu.core.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.github.lvyanyang.core.*;
import com.github.lvyanyang.sys.entity.SysDic;
import com.github.lvyanyang.sys.service.SysDicService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 试题库
 * @author 马星俊 maxingjun@xci96716.com
 * @since 2020-11-25 10:03:01
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "试题库")
public class EduQuestion extends BaseOperateUserEntity {
    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ExcelIgnore
    @Excel(name = "主键", width = 20d)
    @ApiModelProperty(value = "主键", position = 1)
    private Long id;

    /**
     * 试题题干
     */
    @NotBlank(message = "试题题干不能为空")
    @Length(max = 2000, message = "试题题干长度不能超过{max}个字符")
    @Excel(name = "试题题干", width = 20d)
    @ApiModelProperty(value = "试题题干", required = true, position = 2)
    private String title;

    /**
     * 试题类型[1-单选题, 2-多选题, 3-判断题]  
     */
    @NotNull(message = "试题类型  不能为空")
    @Excel(name = "试题类型  ", width = 20d, replace = { "单选题_1", "多选题_2", "判断题_3" })
    @ApiModelProperty(value = "试题类型[1-单选题, 2-多选题, 3-判断题]  ", required = true, position = 3)
    private Integer questionCategory;

    /**
     * 试题类型名称
     */
    @Excel(name = "试题类型名称", width = 20d)
    @ApiModelProperty(value = "试题类型名称", position = 3)
    private String questionCategoryName;

    /**
     * 试题类型名称
     */
    public String getQuestionCategoryName(){
        switch(questionCategory) {
            case 1:
                return "单选题";
            case 2:
                return "多选题";
            case 3:
                return "判断题";
        }
        return Const.Empty;
    }

    /**
     * 科目主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @NotNull(message = "科目主键不能为空")
    @Excel(name = "科目主键", width = 20d)
    @ApiModelProperty(value = "科目主键", required = true, position = 4)
    private Long eduCategoryId;

    /**
     * 科目名称
     */
    @NotBlank(message = "科目名称不能为空")
    @Length(max = 50, message = "科目名称长度不能超过{max}个字符")
    @Excel(name = "科目名称", width = 20d)
    @ApiModelProperty(value = "科目名称", required = true, position = 5)
    private String eduCategoryName;

    /**
     * 选项A
     */
    @NotBlank(message = "选项A不能为空")
    @Length(max = 2000, message = "选项A长度不能超过{max}个字符")
    @Excel(name = "选项A", width = 20d)
    @ApiModelProperty(value = "选项A", required = true, position = 6)
    private String optionA;

    /**
     * 选项B
     */
    @Length(max = 2000, message = "选项B长度不能超过{max}个字符")
    @Excel(name = "选项B", width = 20d)
    @ApiModelProperty(value = "选项B", position = 7)
    private String optionB;

    /**
     * 选项C
     */
    @Length(max = 2000, message = "选项C长度不能超过{max}个字符")
    @Excel(name = "选项C", width = 20d)
    @ApiModelProperty(value = "选项C", position = 8)
    private String optionC;

    /**
     * 选项D
     */
    @Length(max = 2000, message = "选项D长度不能超过{max}个字符")
    @Excel(name = "选项D", width = 20d)
    @ApiModelProperty(value = "选项D", position = 9)
    private String optionD;

    /**
     * 选项E
     */
    @Length(max = 2000, message = "选项E长度不能超过{max}个字符")
    @Excel(name = "选项E", width = 20d)
    @ApiModelProperty(value = "选项E", position = 10)
    private String optionE;

    /**
     * 选项F
     */
    @Length(max = 2000, message = "选项F长度不能超过{max}个字符")
    @Excel(name = "选项F", width = 20d)
    @ApiModelProperty(value = "选项F", position = 11)
    private String optionF;

    /**
     * 答案
     */
    @NotBlank(message = "答案不能为空")
    @Length(max = 50, message = "答案长度不能超过{max}个字符")
    @Excel(name = "答案", width = 20d)
    @ApiModelProperty(value = "答案", required = true, position = 12)
    private String answer;

    /**
     * 答案解析
     */
    @NotBlank(message = "答案解析不能为空")
    @Length(max = 2000, message = "答案解析长度不能超过{max}个字符")
    @Excel(name = "答案解析", width = 20d)
    @ApiModelProperty(value = "答案解析", required = true, position = 13)
    private String answerResolve;

    /**
     * 分值
     */
    @NotNull(message = "分值不能为空")
    @Excel(name = "分值", width = 20d)
    @ApiModelProperty(value = "分值", required = true, position = 14)
    private Integer score;

    /**
     * 状态[1-启用, 0-禁用]
     */
    @NotNull(message = "状态不能为空")
    @Excel(name = "状态", width = 20d, replace = { "启用_1", "禁用_0" })
    @ApiModelProperty(value = "状态[1-启用, 0-禁用]", required = true, position = 15)
    private Integer status;

    /**
     * 备注
     */
    @Length(max = 500, message = "备注长度不能超过{max}个字符")
    @Excel(name = "备注", width = 20d)
    @ApiModelProperty(value = "备注", position = 16)
    private String remark;

}